﻿using System;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Text;
using Elderos.Highlight;
using Elderos.Highlight.Search;
using Elderos.Ontology;

namespace HighlighterConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            string entitiesString = ConfigurationManager.ConnectionStrings["Ontology"].ConnectionString;
            var ontology = new OntologyData(entitiesString);
            ontology.Initialize();

            var synonymEntityCount = ontology.EstimatedSynonymCount;

            var searcher = new CompactSearcher(ontology, synonymEntityCount);
            searcher.InitializationProgress +=
                (complete, count, total) =>
                    Console.WriteLine("{0} percent comlete ({1} of {2})", complete, count, total);


            var highlighter = new Highlighter(
                new ISearchStrategy[]{searcher, /*new PeopleSearcher(ontology)*/},
                new SearchResultAdapter(), 
                new RuleRanker(ontology),
                new SimpleAmbiguityResolver(1),
                ontology
                );
            var result =
                highlighter.Highlight("New York, today. New York City is growing up.");

        }
    }
}
